home *** CD-ROM | disk | FTP | other *** search
- import java.io.IOException;
- import java.util.Random;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- // $FF: renamed from: HC
- public class class_0 extends Canvas {
- private static Random rand = new Random();
- // $FF: renamed from: m1 Mogura
- private Mogura field_0 = new Mogura(1);
- // $FF: renamed from: m2 Mogura
- private Mogura field_1 = new Mogura(2);
- // $FF: renamed from: m3 Mogura
- private Mogura field_2 = new Mogura(3);
- // $FF: renamed from: ml int
- private int field_3;
- private int life;
- static int score;
- static int stnum;
- static boolean playSt;
- static boolean gameover;
- Image mmo;
- // $FF: renamed from: hg javax.microedition.lcdui.Image
- Image field_4;
-
- public class_0() {
- try {
- this.mmo = Image.createImage("/minimogu.png");
- this.field_4 = Image.createImage("/heart.png");
- } catch (IOException var1) {
- }
-
- }
-
- public void hit(int var1) {
- Object var2 = null;
- Mogura var3;
- if (var1 == 1) {
- var3 = this.field_0;
- } else if (var1 == 2) {
- var3 = this.field_1;
- } else {
- var3 = this.field_2;
- }
-
- if (var3.returnMmove() <= 6 && var3.returnMmove() > 1) {
- if (var3.hanaSt()) {
- if (score > 50) {
- score -= 50;
- }
-
- this.life -= 2;
- this.field_3 += 2;
- } else {
- score += 10;
- --this.field_3;
- }
-
- var3.hit();
- }
-
- }
-
- public void init() {
- score = 0;
- stnum = 0;
- playSt = false;
- }
-
- public void keyPressed(int var1) {
- int var2 = ((Canvas)this).getGameAction(var1);
- switch (var2) {
- case 2:
- this.hit(1);
- return;
- case 3:
- case 4:
- default:
- return;
- case 5:
- this.hit(3);
- return;
- case 6:
- this.hit(2);
- }
- }
-
- public synchronized void paint(Graphics var1) {
- if (this.life < 1) {
- gameover = true;
- playSt = false;
- }
-
- if ((rand.nextInt() >>> 1) % 100 < 40 && !this.field_0.isMove()) {
- this.field_0.start(stnum);
- }
-
- if ((rand.nextInt() >>> 1) % 100 < 40 && !this.field_1.isMove()) {
- this.field_1.start(stnum);
- }
-
- if ((rand.nextInt() >>> 1) % 100 < 40 && !this.field_2.isMove()) {
- this.field_2.start(stnum);
- }
-
- var1.setColor(16777215);
- var1.fillRect(9, 4, 90, 40);
- this.field_0.paint(var1);
- this.field_1.paint(var1);
- this.field_2.paint(var1);
- if (this.field_0.returnMmove() == 7 && !this.field_0.hanaSt()) {
- --this.life;
- }
-
- if (this.field_1.returnMmove() == 7 && !this.field_1.hanaSt()) {
- --this.life;
- }
-
- if (this.field_2.returnMmove() == 7 && !this.field_2.hanaSt()) {
- --this.life;
- }
-
- var1.setColor(0);
- var1.drawString("Score : " + score, 30, 5, 20);
- var1.drawImage(this.field_4, 10, 19, 20);
- var1.drawString(" x " + this.life, 23, 19, 20);
- var1.drawImage(this.mmo, 60, 19, 20);
- var1.drawString(" x " + this.field_3, 73, 19, 20);
- if (this.field_3 < 1) {
- playSt = false;
- }
-
- }
-
- public int returnH() {
- return this.life;
- }
-
- public int returnS() {
- return score;
- }
-
- public void startSet() {
- this.field_0.init();
- this.field_1.init();
- this.field_2.init();
- this.field_3 = 20;
- this.life = 20;
- playSt = true;
- gameover = false;
- }
- }
-